<?php 
/**
 * This file acts as the "front controller" to your application. You can
 * configure your application and system directories here.
 *
 * PHP error_reporting level may also be changed.
 */
 
/**
 * Define the website environment status.
 */
define('IN_PRODUCTION', FALSE);

/**
 * Website Pages
 * This path can be absolute or relative to this file.
 */
$micro_pages = 'pages';

/**
 * Addons and Libraries
 * This path can be absolute or relative to this file.
 */
$micro_classes = 'classes';

/**
 * Micro system directory
 * This path can be absolute or relative to this file.
 */
$micro_system = 'system';

/**
 * Test to make sure that Micro is running on PHP 5.2 or newer. 
 */
version_compare(PHP_VERSION, '5.2', '<') and exit('Micro requires PHP 5.2 or newer.');

/**
 * Set the error reporting level. Unless you have a special need, E_ALL is a
 * good level for error reporting.
 */
error_reporting(E_ALL & ~E_STRICT);

/**
 * Turning off display_errors will effectively disable Kohana error display
 * and logging. You can turn off Kohana errors in application/config/config.php
 */
ini_set('display_errors', TRUE);

/**
 * If you rename all of your .php files to a different extension, set the new
 * extension here. This option can left to .php, even if this file has a
 * different extension.
 */
define('EXT', '.php');

// ------------------------------------------------------------------------------ //
// ----------------------- Do Not Edit Below ------------------------------------ //
// ------------------------------------------------------------------------------ //

$micro_pathinfo = pathinfo(__FILE__);
// Define the front controller name and docroot
define('DOCROOT', $micro_pathinfo['dirname'].DIRECTORY_SEPARATOR);
define('MICRO',  $micro_pathinfo['basename']);

// If the front controller is a symlink, change to the real docroot
is_link(MICRO) and chdir(dirname(realpath(__FILE__)));

// If Micro folders are relative paths, make them absolute.
$micro_pages = file_exists($micro_pages) ? $micro_pages : DOCROOT.$micro_pages;
$micro_classes = file_exists($micro_classes) ? $micro_classes : DOCROOT.$micro_classes;
$micro_system = file_exists($micro_system) ? $micro_system : DOCROOT.$micro_system;

// Define application and system paths
define('PAGES', str_replace('\\', '/', realpath($micro_pages)).'/');
define('CLASSES', str_replace('\\', '/', realpath($micro_classes)).'/');
define('SYSPATH', str_replace('\\', '/', realpath($micro_system)).'/');

// Clean up
unset($micro_pages, $micro_system, $micro_classes);

// Initialize Micro
	require SYSPATH.'Bootstrap'.EXT;
?>